<template>
  <div class="hello">
      
   商品名:{{ name }}
  
   <button @click="add">添加购物车</button>

  </div>
</template>

<script>
  export default {
    name: 'HelloWorld',
    data(){
      return{
        name:"雷蛇鼠标"
      }

    },
    props: {
      msg: String
    },
    

    methods:{
      add(){
        this.$bus.$emit("addName",this.name);
      }
    }
  }
</script>

